import 'dart:async';

import 'package:flutter_test/flutter_test.dart';

void main() {
  Future<int> slowInt() async {
    // await Future.delayed(const Duration(seconds: 2));
    return 2;
  }

  Future<String> delayedString() async {
    await Future.delayed(const Duration(seconds: 2));
    throw TimeoutException('Time has passed');
  }

  Future<int> fastInt() async {
    // await Future.delayed(const Duration(seconds: 1));
    return 3;
  }

  testWidgets('WebSocket connection and message handling test',
      (WidgetTester widgetTester) async {
    var result = await Future.any([
      slowInt(),
      // delayedString(),
      fastInt()
    ]);

    print(result);
  });
}
